<?php
/**
 * Date rule
 * Validates that value is a date in a specific format.
 *
 * @todo This is unfinished. It needs to be capable of validating dates in any
 * number of formats based on month, date and year in a specific order.
 * Currently it only validates that the string length is correct.
 * @package     Q-Validate
 * @subpackage  Rules
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: Date.php 37 2010-12-23 02:38:44Z luke.visinoni $
 */
class Q_Rule_Date extends Q_Rule_Abstract {

    /**
     * The parameters that were passed to this rule
     */
    protected $_params = array(
        'format' => 'MMDDYYYY',
    );
    
    public function isValid($value) {
    
        // this is temporary - later this needs to format based on format
        $len = strlen($this->getParam('format'));
        return ($len == strlen(get_digits($value)));
    
    }

}
